package com.hotel.service.impl;

import com.hotel.mapper.RoomMapper;
import com.hotel.pojo.Room;
import com.hotel.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;
    public List<Room> getAll() {
        return roomMapper.getAll();
    }

    public void addRoom(Room room) {
        roomMapper.addRoom(room);
    }

    @Override
    public Room selectRoomById(int id) {
        return roomMapper.selectRoomById(id);
    }

    @Override
    public void updateRoom(Room room) {
        roomMapper.updateRoom(room);
    }

    @Override
    public void deleteRoomById(int id) {
        roomMapper.deleteRoomById(id);
    }

    @Override
    public List<Room> selectRoomByName(String selectRoomName) {
        return roomMapper.selectRoomByName(selectRoomName);
    }
}
